package c_prototype;

/**
 *  通过浅克隆 ，基本类型，无所谓，引用类型，仍然指向同一个内存地址
 *
 *
 */

public class CitationTest {
    public static void main(String[] args) throws CloneNotSupportedException {
        Citation c1 = new Citation();
        Student stu = new Student("张三", "西安");
        c1.setStu(stu);
        c1.setName("张三");

        //复制奖状
        Citation c2 = c1.clone();
        Student stu1 = c2.getStu();
        //将奖状的名字修改李四
        c2.setName("李四");
        c2.setStu(stu1);

        //判断stu对象和stu1对象是否是同一个对象
        System.out.println("stu和stu1是同一个对象？" + (stu == stu1));


        c1.show();
        c2.show();

        System.out.println("==================");
        c1.show2();
        c2.show2();

    }

}
